<template>
	<div class="desc-container">
		<h4 class="desc-title">{{ descInfo.title }}</h4>
		<hr>
		<div class="desc-content" v-html="descInfo.content"></div>
	</div>
</template>

<script>
	import { Toast } from 'mint-ui';
	export default {
		data(){
			return {
				id: this.$route.params.id,
				descInfo: {}
			}
		},
		methods: {
			getDescInfo(){
				this.$http.get(`api/goods/getdesc/${this.id}`).then(res=>{
					if (res.body.status == 0) {
						this.descInfo = res.body.message[0];
					} else {
						Toast('获取图文数据失败！');
					}
				})
			}
		},
		created(){
			this.getDescInfo();
		}
	}
</script>

<style lang="scss">
	.desc-container{
		padding: 0px 6px;
		.desc-title{
			text-align: center;
			color: #007AFF;
			margin: 15px 0px;
		}
		img{
			width: 100%;
		}
	}
</style>
